#ifndef _REFINEMENT_INDUCTION
#define _REFINEMENT_INDUCTION

class rINDUCTIONHypothesis : public Hypothesis {
public:

	bool learn(List<FeatureTerm> *cases,Path *description_path,Path *solution_path,Ontology *o,FTKBase *domain_model);
	bool learn_single_class(FeatureTerm *solution,List<FeatureTerm> *cases,Path *description_path,Path *solution_path,Ontology *o,FTKBase *domain_model);
	
	bool learn2(List<FeatureTerm> *cases,Path *description_path,Path *solution_path,Ontology *o,FTKBase *domain_model);
	bool learn2_single_class(FeatureTerm *solution,List<FeatureTerm> *cases,Path *description_path,Path *solution_path,Ontology *o,FTKBase *domain_model);

	bool learn3(List<FeatureTerm> *cases,Path *description_path,Path *solution_path,Ontology *o,FTKBase *domain_model);
	bool learn3_single_class(FeatureTerm *solution,List<FeatureTerm> *cases,Path *description_path,Path *solution_path,Ontology *o,FTKBase *domain_model);

	bool new_coverage_p(FeatureTerm *solution,bool *coverage,int len);
	void show_coverage(bool *coverage,int len);
	void filter_rules(FeatureTerm *solution,int len,Ontology *o,FTKBase *dm);
	void filter_rules_heuristic(int total_nrules,int nexamples,int *combination,int *current_coverage,int *rule_costs,int *pattern_correspondence,int *min_nrules,int *min_cost,int *min_combination);
	void filter_rules_auxiliar(int total_nrules,int nexamples,int current,int nrules,int cost,int *combination,int *current_coverage,int *rule_costs,int *pattern_correspondence,int *min_nrules,int *min_cost,int *min_combination);
	FeatureTerm *generalize_pattern(FeatureTerm *pattern,List<FeatureTerm> *positive,List<FeatureTerm> *negative,Ontology *o,FTKBase *domain_model);
	FeatureTerm *generalize_pattern_systematic(FeatureTerm *pattern,List<FeatureTerm> *positive,List<FeatureTerm> *negative,Ontology *o,FTKBase *domain_model);

//	FeatureTerm *solve_problem(FeatureTerm *problem,FTKBase *domain_model);
//	void show_rule_set(FTKBase *domain_model);
	
	List<FeatureTerm> m_patterns;
	List<FeatureTerm> m_solutions;
	List<float> m_reliability;
	List<bool> m_positive_coverage;		/* contains a vector with a boolean per each positive example, saying if the 
										   pattern subsumes that example or not	*/ 
	FeatureTerm *m_default_solution;
};

#endif

